<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<script src="vue.min.js"></script>
	<link rel="stylesheet" href="">
</head>
<body>
	<div id="app">
		<button @click="toggel">切换</button>

		<h3 v-if="flag">这是用v-if控制的元素</h3>
    	<h3 v-show="flag">这是用v-show控制的元素</h3>

	</div>
	<script>
		var vm = new Vue({
			el: '#app',
			data: {
				flag: true
			},
			methods: {
				toggel(){
					this.flag = !this.flag;
				}
			}
		});
	</script>
</body>
</html>